import { redirect } from "next/navigation";
import { getMe } from "./actions";

export default async function Page() {
  const $me = await getMe();
  if (!$me.ok) {
    redirect("/login");
  }

  const me = $me.data;

  return (
    <div>
      <ul>
        <li>id: {me.id}</li>
        <li>username: {me.username}</li>
        <li>createTime: {me.createTime.toISOString()}</li>
      </ul>
    </div>
  );
}
